package org.dromara.merchants.domain.vo;

import org.dromara.common.translation.annotation.Translation;
import org.dromara.common.translation.constant.TransConstant;
import org.dromara.merchants.domain.TaGoods;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
import java.util.List;


/**
 * 商品视图对象 ta_goods
 *
 * @author xiyin321
 * @date 2024-07-02
 */
@Data
@ExcelIgnoreUnannotated

@AutoMapper(target = TaGoods.class)
public class TaGoodsVo implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 商品编号
     */
    @ExcelProperty(value = "商品编号")
    private Long goodsId;

    /**
     * 所属店铺id
     */
    @ExcelProperty(value = "所属店铺id")
    private Long storeId;

    /**
     * 所属店铺分类id
     */
    @ExcelProperty(value = "所属店铺分类id")
    private Long classificationId;

    /**
     * 所属分类id
     */
    @ExcelProperty(value = "所属分类id")
    private Long categoryId;

    /**
     * 商品名
     */
    @ExcelProperty(value = "商品名")
    private String goodsName;

    /**
     * 价格
     */
    private String price;

    /**
     * 描述
     */
    @ExcelProperty(value = "描述")
    private String description;

    /**
     * 商品图片
     */
    @ExcelProperty(value = "商品图片")
    private Long image;

    @Translation(type = TransConstant.OSS_ID_TO_URL)
    private Long imageUrl;

    /**
     * 是否上架
     */
    @ExcelProperty(value = "是否上架")
    private String isStatus;


    private TaStoreVo store;
    private TaCustomClassificationVo classification;
    private TaCategoryVo category;
    /**
     * 关联列表
     */
    private List<TaAssociationVo> associationList;

    public void setImage(Long image) {
        this.image = image;
        this.imageUrl = image;
    }
}
